package com.mmall.concurrency.listener;

import lombok.Data;
import org.springframework.context.ApplicationEvent;

import java.util.Objects;

/**
 * TODO
 *
 * @author ryany
 * @date 2022/1/17 21:13
 */
public class LazadaTransactionEvent extends ApplicationEvent {
    public LazadaTransactionEvent(LazadaTransactionData source) {
        super(source);
    }

    @Data
    public static class LazadaTransactionData{
        private String sid;

        private String shopId;

        private String startDate;

        private String endDate;

        public String getSid() {
            return sid;
        }

        public void setSid(String sid) {
            this.sid = sid;
        }

        public String getShopId() {
            return shopId;
        }

        public void setShopId(String shopId) {
            this.shopId = shopId;
        }

        public String getStartDate() {
            return startDate;
        }

        public void setStartDate(String startDate) {
            this.startDate = startDate;
        }

        public String getEndDate() {
            return endDate;
        }

        public void setEndDate(String endDate) {
            this.endDate = endDate;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            LazadaTransactionData that = (LazadaTransactionData) o;
            return Objects.equals(sid, that.sid) &&
                    Objects.equals(shopId, that.shopId) &&
                    Objects.equals(startDate, that.startDate) &&
                    Objects.equals(endDate, that.endDate);
        }

        @Override
        public int hashCode() {
            return Objects.hash(sid, shopId, startDate, endDate);
        }
    }
}
